#include <stdio.h>

int num[29];
int main()
{
    int n;
    scanf("%d",&n);
    int max = -10000;
    int where = 0;
    for(int i=0;i<n;i++) 
    {
        scanf("%d",&num[i]);
        if(num[i] > max)
        {
            max = num[i];
            where = i;
        }
    }
    printf("%d %d\n",max,where);
    return 0;
}